class PaisesController < ApplicationController
  before_filter :authorized?

  ## Métodos/acciones typical scaffold ##
  def index
    @paises = Pais.find(:all, :order => "nombre")

    respond_to do |format|
      format.html # index.rhtml
    end
  end

  def show
    @pais = Pais.find(params[:id])

    respond_to do |format|
      format.html # show.rhtml
    end
  end

  def new
    @pais = Pais.new
  end

  def edit
    @pais = Pais.find(params[:id])
  end

  def create
    @pais = Pais.new(params[:pais])

    respond_to do |format|
      if @pais.save
        flash[:notice] = 'Pais was successfully created.'
        format.html { redirect_to pais_url(@pais) }
      else
        format.html { render :action => "new" }
      end
    end                              
  end

  def update
    @pais = Pais.find(params[:id])

    respond_to do |format|
      if @pais.update_attributes(params[:pais])
        flash[:notice] = 'Pais was successfully updated.'
        format.html { redirect_to pais_url(@pais) }
      else
        format.html { render :action => "edit" }
      end
    end
  end

  def destroy
    @pais = Pais.find(params[:id])
    @pais.destroy

    respond_to do |format|
      format.html { redirect_to paises_url }
    end
  end 

  ## /Métodos/acciones typical scaffold ##
end